package com.xiaoji.ssh.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
@Table(name = "roles_resources")
public class RolesResources implements Serializable{
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="rrid",unique=true,nullable=false)
	private String rrid;
	
	@ManyToOne
	@JoinColumn(name="role_id")
	private Roles rid;
	
	@ManyToOne
	@JoinColumn(name="rosources_id")
	private Resources rsid;

	public String getRrid() {
		return rrid;
	}

	public void setRrid(String rrid) {
		this.rrid = rrid;
	}

	public Roles getRid() {
		return rid;
	}

	public void setRid(Roles rid) {
		this.rid = rid;
	}

	public Resources getRsid() {
		return rsid;
	}

	public void setRsid(Resources rsid) {
		this.rsid = rsid;
	}

	@Override
	public String toString() {
		return "RolessResources [rrid=" + rrid + ", rid=" + rid + ", rsid="
				+ rsid + "]";
	}

	public RolesResources() {
		super();
	}

	public RolesResources(String rrid, Roles rid, Resources rsid) {
		this.rrid = rrid;
		this.rid = rid;
		this.rsid = rsid;
	}

	
}
